如何修复WordPress中的“上传:无法将文件写入磁盘”错误 您所在的位置:网站首页 父目录wwwwwwroot不可写 如何修复WordPress中的“上传:无法将文件写入磁盘”错误

如何修复WordPress中的“上传:无法将文件写入磁盘”错误

2024-06-18 09:51| 来源: 网络整理| 查看: 265

Are you seeing ‘Upload: Failed to write file to disk’ error when uploading files in WordPress? This common error can be very frustrating for beginner users. In this article, we will show you how to fix “Upload: failed to write file to disk” error in WordPress.

在WordPress中上传文件时是否看到“上传:无法将文件写入磁盘”错误? 对于初学者而言,此常见错误可能会非常令人沮丧。 在本文中,我们将向您展示如何解决WordPress中的“上传:无法将文件写入磁盘”错误。

Upload failed to write file to disk error in WordPress 是什么原因导致无法在WordPress中将文件写入磁盘错误? (What Causes Failed To Write File To Disk Error in WordPress?)

This error can occur due to a number of reasons. However, the most common one is incorrect folder permissions.

由于多种原因,可能会发生此错误。 但是,最常见的一种是不正确的文件夹权限。

Each file and folder on your website has a set of permissions. Your web server controls access to the files based on these permissions.

您网站上的每个文件和文件夹都有一组权限 。 您的Web服务器根据这些权限控制对文件的访问。

Incorrect permissions to a folder can take away your ability to write files on server. This means your web server cannot create or add new files to that particular folder.

对文件夹的错误权限可能会使您无法在服务器上写入文件。 这意味着您的Web服务器无法创建新文件或将新文件添加到该特定文件夹。

If you try to upload images or any other files from WordPress admin area, you will get one of the following error messages:

如果您尝试从WordPress 管理区域上传图像或任何其他文件,则会收到以下错误消息之一:

WordPress failed to write to disk

WordPress无法写入磁盘 WordPress has failed to upload due to an error failed to write file to disk

WordPress由于无法将文件写入磁盘失败而无法上传 Unable to create directory wp-content/uploads/2016/03. Is its parent directory writable by the server?

无法创建目录wp-content / uploads / 2016/03。 服务器的父目录是否可写? 修复WordPress中的上传无法写入磁盘错误 (Fix Upload Failed to Write to Disk Error in WordPress)

First, you need to connect to your WordPress site using a FTP client.

首先,您需要使用FTP客户端连接到WordPress网站。

For this tutorial, we are using the free FileZilla FTP client. If you are using some other FTP client, then it might look a little different.

对于本教程,我们使用免费的FileZilla FTP客户端 。 如果使用其他FTP客户端,则外观可能会有些不同。

Once you are connected, you need to right click on the wp-content folder and select file permissions.

连接后,需要右键单击wp-content文件夹,然后选择文件权限。

FTP file permissions

This will bring up file permissions dialog box in your FTP client. It will show you file permissions for owner, group, and public.

这将在您的FTP客户端中弹出文件权限对话框。 它将显示您对所有者,组和公共的文件权限。

Changing file permissions for wp-content folder

You need to enter 755 in the numeric value field.

您需要在数值字段中输入755。

After that, you need to check the box next to ‘Recurse into subdirectories’.

之后,您需要选中“递归到子目录”旁边的框。

Lastly, you need to click on ‘Apply to directories only’ option.

最后,您需要单击“仅应用于目录”选项。

Click on the OK button to continue.

单击确定按钮继续。

Your FTP client will now set folder permissions to 755 and apply it to all sub-folders inside wp-content. This includes uploads folder where all your images are stored.

您的FTP客户端现在将文件夹权限设置为755,并将其应用于wp-content中的所有子文件夹。 这包括用于存储所有图像的上载文件夹。

You also want to make sure that file permissions for individual files in your wp-content folder are correct.

您还想确保wp-content文件夹中单个文件的文件权限正确。

Once again, right click on wp-content folder and select file permissions. This time we will change permissions for files.

再次右键单击wp-content文件夹,然后选择文件权限。 这次,我们将更改文件的权限。

Enter 644 in the numeric value and then check the box next to ‘Recurse into subdirectories’.

在数值中输入644,然后选中“递归到子目录”旁边的框。

Lastly, you need to click on ‘Apply to files only’ option.

最后,您需要点击“仅应用于文件”选项。

Click on the OK button to continue. Your FTP client will now set file permissions to 644 for all files in wp-content folder.

单击确定按钮继续。 现在,您的FTP客户端会将wp-content文件夹中的所有文件的文件权限设置为644。

You can now visit your WordPress site and try uploading files.

现在,您可以访问WordPress网站并尝试上传文件。

If you still see the error, then you will need to contact your WordPress hosting provider and ask them to empty the temporary files directory.

如果仍然看到错误,则需要联系WordPress托管提供商,并要求他们清空临时文件目录。

WordPress uploads your images using PHP which first saves the uploads to a temporary directory on your web server. After that it moves them to your WordPress uploads folder.

WordPress使用PHP上传您的图片,该图片首先将上传的内容保存到Web服务器上的临时目录中。 之后,它将它们移动到您的WordPress上载文件夹。

If this temporary directory is full or is poorly configured, then WordPress will not be able to write the file to disk.

如果此临时目录已满或配置不正确,则WordPress将无法将文件写入磁盘。

This temporary folder is located on your server and in most cases you cannot access it using FTP. You will need to contact your web host and ask them to empty it for you.

此临时文件夹位于您的服务器上,在大多数情况下,您无法使用FTP访问它。 您需要联系您的虚拟主机,并要求他们为您清空。

We hope this article helped you resolve ‘Upload: Failed to Write File to Disk’ Error in WordPress. You may also want to see our guide on how to fix common image issues in WordPress.

我们希望本文能帮助您解决WordPress中的“上传:无法将文件写入磁盘”错误。 您可能还希望查看有关如何解决WordPress中常见图像问题的指南。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Facebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-fix-upload-failed-to-write-file-to-disk-error-in-wordpress/



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有